import requests

response = requests.get('https://www.baidu.com/')
# 获取包含重定向历史的列表
print(response.history)

# 返回最终响应的url
print(response.url)